package factory.simple;

/**
 * 简单工厂
 */
public class Factory {
    public static Product create(String type){
        if ("A".equals(type)){
            return new ProductA();
        }
        if ("B".equals(type)){
            return new ProductB();
        }
        throw new RuntimeException("Invalid type");
    }
}
